﻿using _0016.Gonggong.Models;
using Prism.Commands;
using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _0016.ViewModels
{
    public class MemoViewModel:BindableBase
    {
        public MemoViewModel()
        {
            BeiWlus = new ObservableCollection<BeiWlu>();
            CreateToDos();
            AddCommand = new DelegateCommand(Add);
        }

        /// <summary>
        /// 右侧编辑窗口是否展开
        /// </summary>
        private bool isRightDrawerOpen;
        public bool IsRightDrawerOpen
        {
            get { return isRightDrawerOpen; }
            set { isRightDrawerOpen = value; RaisePropertyChanged(); }
        }
        /// <summary>
        /// 添加备忘录
        /// </summary>
        private void Add()
        {
            IsRightDrawerOpen = true;
        }
        public DelegateCommand AddCommand { get; private set; }

        private ObservableCollection<BeiWlu> beiWlus;
        public ObservableCollection<BeiWlu> BeiWlus
        {
            get { return beiWlus; }
            set { beiWlus = value; RaisePropertyChanged(); }
        }
        void CreateToDos()
        {
            for (int i = 0; i < 20; i++)
            {
                BeiWlus.Add(new BeiWlu { Title = "标题" + (i + 1), Neirong = "测试数据...." });
            }

        }
    }
}